import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/asset_general_detail_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class AssetGeneralDetailEntity {
  late int code = 0;
  late String msg;
  late AssetGeneralDetailData data = AssetGeneralDetailData();

  AssetGeneralDetailEntity();

  factory AssetGeneralDetailEntity.fromJson(Map<String, dynamic> json) =>
      $AssetGeneralDetailEntityFromJson(json);

  Map<String, dynamic> toJson() => $AssetGeneralDetailEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class AssetGeneralDetailData {
  late List<AssetGeneralDetailDataData> data = [];

  AssetGeneralDetailData();

  factory AssetGeneralDetailData.fromJson(Map<String, dynamic> json) =>
      $AssetGeneralDetailDataFromJson(json);

  Map<String, dynamic> toJson() => $AssetGeneralDetailDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class AssetGeneralDetailDataData {
  late String id;
  @JSONField(name: "user_id")
  late String userId;
  late String money;
  late String before;
  late String after;
  late String type;
  late String memo;
  @JSONField(name: "item_id")
  late String itemId;
  late String ext;
  @JSONField(name: "created_at")
  late String createdAt;
  @JSONField(name: "updated_at")
  late String updatedAt;

  AssetGeneralDetailDataData();

  factory AssetGeneralDetailDataData.fromJson(Map<String, dynamic> json) =>
      $AssetGeneralDetailDataDataFromJson(json);

  Map<String, dynamic> toJson() => $AssetGeneralDetailDataDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
